package DesignPattern.Proxy;

public class Static {
    public static void main(String[] args) {
        new ObjectProxy(new SourceObject()).sendMsg();
    }
}

interface ProxyInterface{
    public void sendMsg();
}

class SourceObject implements ProxyInterface{

    @Override
    public void sendMsg() {
        System.out.println("SourceObject");
    }
}

class ObjectProxy implements ProxyInterface{
    private SourceObject object;

    public ObjectProxy(ProxyInterface object) {
        this.object = (SourceObject) object;
    }

    @Override
    public void sendMsg() {
        object.sendMsg();
    }
}
